package com.example.demo.jdk.proxy.static_proxy;

/**
 * 代理对象，静态代理
 * @author: htc
 * @date: Created in 10:46 2019/2/20.
 */
public class UserDaoProxy implements IUserDao {
    /**
     * 接收保存对象目标
     */
    private IUserDao target;

    public UserDaoProxy(IUserDao target) {
        this.target = target;
    }

    @Override
    public void save() {
        System.out.println("开始事务。。。。");
        //执行目标对象的方法
        target.save();
        System.out.println("提交事务。。。。");

    }
}
